import { defineComponent } from "vue";

export default defineComponent({
    name: 'PageItem',
    props: {
        active: Boolean,
        currentIndex: [Number, String],
    },
    emits: ['click'],
    setup (props, { emit }) {
        const onClick = () => {
            emit('click');
        };
        const classList = () => ({
            'cm-pagination-num': true,
            'cm-pagination-item-active': props.active
        });
        return () => <li onClick={onClick} class={classList()}>
            {props.currentIndex}
        </li>;
    }
});
